@layout("/backend/common/_container.html"){

<div class="dhcc-form">
    <div class="hisui-panel" fit='true' title="条目维护"
         data-options="fit:true,headerCls:'panel-header-gray'"
         style="border-bottom:1px solid #ccc;border-radius:0;width: 100%">
        <form method='post' id="contraindicationItemInfoForm" name="contraindicationItemInfoForm"
              enctype="multipart/form-data" style="height: 100%">

            <table style="border-collapse:separate;border-spacing:5px;" fit='true'>
                <tr>
                    <input class='textbox' id="contraindicationItemId" type="hidden" value="${contraindicationItem.id}">

                    <td style="text-align:left">条目名称</td>
                    <td style="width:300px">
                        <input class='textbox' id="itemName"
                               value="${contraindicationItem.itemName}">
                    </td>

                    <td style="text-align:left;">是否有效</td>
                    <td style="width:300px">
                        <div id="active" class="hisui-switchbox" style="margin-left:0px"
                             data-options="onText:'是',offText:'否',size:'small',animated:true,onClass:'primary',offClass:'gray',
                             checked:${contraindicationItem.active}==1?true:false ">
                        </div>
                    </td>
                </tr>
                <tr>
                    <td style="text-align:left;">匹配规则</td>
                    <td style="width:300px">

                        <div id="matchRuleSwi" class="hisui-switchbox" style="margin-left:0px"
                             data-options="onText:'有',offText:'无',size:'small',animated:true,onClass:'primary',offClass:'gray',
                                    checked:${contraindicationItem.hasRule} ,
                                    onSwitchChange: function(event,obj){
                                    if(obj.value==false){
                                        document.getElementById('rulediv').style.display='none';
                                        document.getElementById('ruleExp').style.visibility='hidden';
                                        document.getElementById('ruleExp1').style.visibility='hidden';
                                    }else{
                                        document.getElementById('rulediv').style.display='block';
                                        document.getElementById('ruleExp').style.visibility='visible';
                                        document.getElementById('ruleExp1').style.visibility='visible';
                                        }}">
                        </div>
                    </td>
                    <td style="text-align:left;" id="ruleExp" >规则表达式</td>
                    <td style="width:300px;" id="ruleExp1">
                        <input id="expression" class='textbox' value="${contraindicationItem.expression}"/>
                    </td>
                </tr>
            </table>

            <div class="hisui-layout" data-options="fit:true" id="rulediv" style="">
                <div class="hisui-panel" fit='true' title='条目规则'
                     data-options="fit:true,headerCls:'panel-header-gray header-tool',tools:'#custtb'"
                     style="border-bottom:1px solid #ccc;border-radius:0; border:0px;padding-top:5px;height:100%">

                    <div id="custtb" style="">
                        <div style="margin-top: -8px">
                            <#Button name="全部" icon="icon-all-select" plain="true" clickFun="Obj.compareAllRule()"/>
                            <#Button name="关联规则" icon="icon-compare-yes" plain="true"
                            clickFun="Obj.compareRelRule()"/>
                            <#Button name="新增" icon="icon-add" plain="true" clickFun="Obj.addRule()"/>
                            <#Button name="修改" icon="icon-write-order" plain="true" clickFun="Obj.editRule()"/>
                            <#Button name="删除" icon="icon-cancel" plain="true" clickFun="Obj.deleteRule()"/>

                        </div>
                    </div>
                    <div style="width: 100%;height: 85%">
                        <table id="ContraindicationItemRuleTable"style="width: 100%"></table>
                    </div>
                </div>
            </div>

            <div class="toolbar">
                <#Button name="保存" id="ensure" icon="icon-w-save" clickFun="Obj.addSubmit()"/>
                <#Button btnCss="l-bt-red" name="关闭" id="cancel" icon="icon-w-close"
                clickFun="Obj.close()"/>
            </div>

        </form>
    </div>

</div>
<script src="${ctxPath}/static/backend/sdc/contraindicationitem/contraindicationitem_rule.js"></script>
@}
